<template>
  <UTable :data="data" :columns="columns" class="flex-1" />
</template>

<script setup lang="ts">
import type { TableColumn } from '@nuxt/ui'
import type { CasePaymentItem } from '~~/shared/types/case'

useHead({
  title: '缴费管理'
})

const UBadge = resolveComponent('UBadge')

const columns: TableColumn<CasePaymentItem>[] = [
  {
    accessorKey: 'clientName',
    header: '委托人'
  },
  {
    accessorKey: 'batch',
    header: '批次'
  },
  {
    accessorKey: 'name',
    header: '姓名'
  },
  {
    accessorKey: 'id',
    header: '案件编号'
  },
  {
    accessorKey: 'orderId',
    header: '订单编号'
  },
  {
    accessorKey: 'payItems',
    header: '缴费项目'
  },
  {
    accessorKey: 'payType',
    header: '缴费类型'
  },
  {
    accessorKey: 'payMoney',
    header: '缴费金额'
  },
  {
    accessorKey: 'payFiles',
    header: '缴费通知书',
    cell: ({ row }) => {
      const { payFiles } = row.original
    }
  },
  {
    accessorKey: 'latestDate',
    header: '最晚日期',
    cell: ({ row }) => {
      const { latestDate } = row.original
      return formatTime(latestDate)
    }
  },
  {
    accessorKey: 'payVouch',
    header: '支付凭证',
    cell: ({ row }) => {}
  },
  {
    accessorKey: 'payStatus',
    header: '缴费状态',
    cell: ({ row }) => {}
  },
  {
    accessorKey: 'payDate',
    header: '缴费日期',
    cell: ({ row }) => {}
  },
  {
    accessorKey: 'creator',
    header: '提交人',
    cell: ({ row }) => {}
  }
]

const data = ref<CasePaymentItem[]>([])
</script>
